.TH LIBPFM 3  "September, 2005" "" "Linux Programmer's Manual"
.SH NAME
libpfm_i386_p6 - support for AMD X86-64 processor family
.SH SYNOPSIS
.nf
.B #include <perfmon/pfmlib.h>
.B #include <perfmon/pfmlib_gen_x86_64.h>
.sp
.SH DESCRIPTION
The libpfm library provides full support for the X86-64 processor family when
running in 64-bit mode. The interface is defined in \fBpfmlib_gen_x86_64.h\fR. It consists
of a set of functions and structures which describe and allow access to the
X86-64 specific PMU features. Note that it does not support Intel EM64T processors.
.sp
When X86-64 processor specific features are needed to support a measurement their descriptions must be passed
as model-specific input arguments to the \fBpfm_dispatch_events\fR call. The X86-64 processors specific 
input arguments are described in the \fBpfmlib_gen_x86_64_input_param_t\fR structure and the output
parameters in \fBpfmlib_gen_x86_64_output_param_t\fR. They are defined as follows:
.sp
.nf
typedef struct {
	unsigned int	cnt_mask;
	unsigned int	flags;
} pfmlib_gen_x86_64_counter_t;

typedef struct {
	pfmlib_gen_x86_64_counter_t	pfp_gen_x86_64_counters[PMU_GEN_X86_64_NUM_COUNTERS];
	uint64_t			reserved[4];
} pfmlib_gen_x86_64_input_param_t;

typedef struct {
	uint64_t	reserved[8];
} pfmlib_gen_x86_64_output_param_t;
.fi
.sp
.sp
The X86-64 processor provides a few additional per-event features for 
counters: thresholding, inversion, edge detection. They can be set using the 
\fBpfp_gen_x86_64_counters\fR data structure for each event.  The \fBflags\fR
field can be initialized as follows:
.TP
.B PFMLIB_GEN_X86_64_SEL_INV
Inverse the results of the \fBcnt_mask\fR comparison when set
.TP
.B PFMLIB_GEN_X86_64_SEL_EDGE
Enables edge detection of events. 
.LP

The \fBcnt_mask\fR field contains is used to set the event threshold.
The value of the counter is incremented each time the number of occurrences
per cycle of the event is greater or equal to the value of the field. When
zero all occurrences are counted.
.sp
.LP
.SH ERRORS
Refer to the description of \fBpfm_dispatch_events()\fR for errors.
.SH SEE ALSO
pfm_dispatch_events(3) and set of examples shipped with the library
.SH AUTHOR
Stephane Eranian <eranian@hpl.hp.com>
.PP
